﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DCode.EmailValidator.UnitTests
{
    [TestClass]
    public class EmailTest
    {
        // TODO: implementations
        // Outlook.com
        // AOL
        // GMX
        // Zoho

        // TODO: validations
        // incorrect syntax
        // bad domain
        
        [TestMethod]
        public void ValidateEmail_Ok_Cloud_Hotmail()
        {
            const string mail = "ricardoretamal969@hotmail.com";

            using (var validator = new Core.Validator())
            {
                //var response = validator.ValidateMail(mail);
                var response = validator.ValidateMail(mail);

                Assert.AreEqual(true, response.IsValid);
            }
        }

        [TestMethod]
        public void ValidateEmail_Ok_Cloud_Gmail()
        {
            const string mail = "rretamal.dev@gmail.com";

            using (var validator = new Core.Validator())
            {
                //var response = validator.ValidateMail(mail);
                var response = validator.ValidateMail(mail);

                Assert.AreEqual(true, response.IsValid);
            }
        }

        [TestMethod]
        public void ValidateEmail_Ok_Cloud_Yahoo()
        {
            const string mail = "test@yahoo.com";

            using (var validator = new Core.Validator())
            {
                //var response = validator.ValidateMail(mail);
                var response = validator.ValidateMail(mail);

                Assert.AreEqual(true, response.IsValid);
            }
        }

        [TestMethod]
        public void ValidateEmail_NOk_Cloud_Hotmail()
        {
            const string mail = "ewfewfwfewef@hotmail.com";

            using (var validator = new Core.Validator())
            {
                //var response = validator.ValidateMail(mail);
                var response = validator.ValidateMail(mail);

                Assert.AreEqual(false, response.IsValid);
            }
        }

        [TestMethod]
        public void ValidateEmail_NOk_Cloud_Gmail()
        {
            const string mail = "ewfewfwfewef@gmail.com";

            using (var validator = new Core.Validator())
            {
                //var response = validator.ValidateMail(mail);
                var response = validator.ValidateMail(mail);

                Assert.AreEqual(false, response.IsValid);
            }
        }

        [TestMethod]
        public void ValidateEmail_NOk_Cloud_Yahoo()
        {
            const string mail = "ewfewfwfewef@yahoo.com";

            using (var validator = new Core.Validator())
            {
                //var response = validator.ValidateMail(mail);
                var response = validator.ValidateMail(mail);

                Assert.AreEqual(false, response.IsValid);
            }
        }
    }
}
